package org.zsl.entity;

import java.util.HashMap;

public class BeanFactory {

    private HashMap beans;

    public  void  init(){

        this.beans = new HashMap();

        /**
         * <bean class="org.zsl.entity.Customer" id="customer1"></bean>
         * */

        /**
         * 反射
         * */
        this.register("customer1",new Customer());
    }

    public  void  register(String key,Object object){
        this.beans.put(key,object);
    }

    public Object getBean(String key){
         return  this.beans.get(key);
    }

}
